algalcommand.io
Class XMLReader

java.lang.Object
  extended by algalcommand.io.XMLReader

public abstract class XMLReader
extends java.lang.Object


Constructor Summary
XMLReader()
           
 
Method Summary
static void main(java.lang.String[] args)
          for testing
static org.w3c.dom.Document parseFile(java.io.File f)
          Deprecated. Will be discontinuing the use of SAX parsers (due to lack of thread safety)
static org.w3c.dom.Element parseXMLString(java.lang.String xml)
          Deprecated. Will be discontinuing the use of SAX parsers (due to lack of thread safety)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLReader

public XMLReader()
Method Detail

parseFile

public static org.w3c.dom.Document parseFile(java.io.File f)
                                      throws org.xml.sax.SAXException,
                                             java.io.IOException
Deprecated. Will be discontinuing the use of SAX parsers (due to lack of thread safety)

Parses an XML file to a org.w3c.dom.Document

Parameters:
f - An XML file to be read
Returns:
Throws:
org.xml.sax.SAXException
java.io.IOException

parseXMLString

public static org.w3c.dom.Element parseXMLString(java.lang.String xml)
                                          throws org.xml.sax.SAXException,
                                                 java.io.IOException
Deprecated. Will be discontinuing the use of SAX parsers (due to lack of thread safety)

Parses a string that represents an XML element, creating all of the neccessary parsers and such.

Parameters:
xml - A string that represents an XML element (e.g. <mytag size="42"/>)
Returns:
An Element object of the XML, or null if it could not be parsed
Throws:
org.xml.sax.SAXException - Thrown if the XML has a syntax error
java.io.IOException - Thrown is there was an error while reading the string's characters

main

public static void main(java.lang.String[] args)
for testing